package cn.bgs.service.Impl;


import cn.bgs.mapper.ToupMapper;
import cn.bgs.service.ToupService;

import cn.bgs.utils.R;
import cn.bgs.vo.Pagevo;
import cn.bgs.vo.TopUpvo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class ToupServiceImpl implements ToupService {

    @Autowired
    ToupMapper toupMapper;
    @Override
    public PageInfo<TopUpvo> page2(Pagevo pagevo) {
        PageHelper.startPage(pagevo.getPageNum(),pagevo.getPageSize());
        List<TopUpvo> toupVoList =toupMapper.selectAll(pagevo.getUserId());
        PageInfo<TopUpvo> c=new PageInfo<>(toupVoList);
        System.out.println("===="+c);
        return c;
    }

    @Override
    public void delete(Integer topUpId) {
      toupMapper.delete(topUpId);
    }

    @Override
    public void updateTop(TopUpvo form) {
        toupMapper.updateTop(form);
    }

    @Override
    public void insertAll(TopUpvo insertaa) {
        toupMapper.insertAll(insertaa);
    }

//    @Override
//    public void updateTop(Integer userId,Integer topUpId) {
//        toupMapper.updateTop(userId,topUpId);
//    }


}
